<?php

 /**
  * @package JooS
  * @subpackage Syntax
  */

  require_once "JooS/Syntax/Abstract.php";

  require_once "JooS/Syntax/Simple/Interface.php";

  abstract class JooS_Syntax_Simple extends JooS_Syntax_Abstract implements JooS_Syntax_Simple_Interface {
    /**
     * @return string
     */
    public function compile() {
      $parser = $this->getParser();

      $length = $this->getLength();
      $substring = $parser->substr($length);
      
      if ($substring !== false) {
        if ($this->checkSubstring($substring)) {
          $parser->shiftPos($length);
        }
        else {
          $substring = false;
        }
      }
      return $substring;
    }
  }
